//
//  TBCustomButton.m
//  Kingka
//
//  Created by Sheldon Peng on 2023/12/8.
//

#import "BJCustomButton.h"

@implementation BJCustomButton

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        [self.iconButton removeFromSuperview];
        
        [self addSubview:self.iconButton];
         
    
        [self.iconButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.bottom.right.mas_equalTo(0);

        }];
    }
    return self;
}



- (UIButton *)iconButton {
    
    if (!_iconButton) {
        
        _iconButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _iconButton.userInteractionEnabled = NO;
        _iconButton.layer.masksToBounds = YES;
        _iconButton.layer.cornerRadius = 16;
//        _iconButton.titleEdgeInsets = UIEdgeInsetsMake(0, 16, 0, 0);
        
    }
    return _iconButton;
}

- (UILabel *)textLabel {
    
    if (!_textLabel) {
        
        _textLabel = [[UILabel alloc] init];
        [_textLabel setTextColor:[UIColor whiteColor]];
        [_textLabel setTextAlignment:NSTextAlignmentLeft];
        [_textLabel setFont:[UIFont systemFontOfSize:12]];
        _textLabel.hidden =YES;
    }
    return _textLabel;
}

- (void)setHighlighted:(BOOL)highlighted {
    
    
}


@end
